swagger: '2.0' info: version: '1' title: Anonymous SMS API description: 'TeleSign''s Anonymous SMS API can be used to create anonymous, limited-duration SMS communication sessions between two end-users without disclosing personal information. Mask phone numbers from view to add privacy, identity protection, and ensure conversations and transactions remain on-platform. Keep conversations between buyers and sellers, drivers and passengers, and delivery personnel and order recipients on-platform and private--without the need to buy and provision virtual numbers.' schemes: - https host: rest-ww.telesign.com basePath: /v1 securityDefinitions: UserSecurity: type: basic paths: /anonymous/session/sms: post: description: |- The Anonymous SMS API allows you to have two end users send and receive SMSes to one another without either party disclosing their phone numbers to one another. You and TeleSign will know their numbers and track their interactions so you can be sure they are not violating your terms of use. All requests submitted for the Anonymous SMS API: * Can be authenticated with [Basic](/api-reference/authentication#basic) (easiest to implement) and [Digest](/api-reference/authentication#digest) authentication * Use `https://rest-ww.telesign.com/v1/anonymous/session/sms` as the base endpoint * Accept only UTF-8 encoded unicode characters as inputs * Use **Content-Type** - application/json in request headers security: - UserSecurity: [] consumes: - application/json produces: - application/json parameters: - in: body name: request_body description: | This is a container for everything you can send in the body of your request. schema: type: object properties: phone_number_1: type: string description: | A string representing the phone number for the end user that will engage in the SMS exchange. phone_number_2: type: string description: | A string representing the phone number for the end user that will engage in the SMS exchange. This number should be different from phone_number_1. validity_period: type: string description: | An integer representing the amount of time in hours you want the two end users to be able to communicate for. The maximum value is 720 hours. responses: '200': description: | Your request was fulfilled and resulted in a new resource being created. If you want to code against a response, you should retrieve the status or error code and use that rather than the HTTP status response. | Status Code | Description | |--|--| | 2700 | Session successfully created | | 2701 | Session successfully created, the country codes of the phone number and assigned sender_id differ. | schema: type: object items: $ref: '#/definitions/postAnonSMSResponse' '201': description: "Your request was fulfilled and resulted in a new resource being created. If you want to code against a response, you should retrieve the status or error code and use that rather than the HTTP status response.\n\n| Status Code | Description |\n|--|--|\n| 2702 | Request for creating session failed, there isn't an available sender_id. |\n| 2703 | Request for creating session failed, invalid session_type | \n| 2704 | Request for creating session failed, internal error | \n| 2705 | Request for creating session failed, validity_period must be an integer greater than zero | \n| 2706 | Request for creating session failed, phone number {phone_number} blocked by TeleSign |\n| 2707 | \tRequest for creating session failed, phone number {phone_number} blocked by customer |\n" schema: type: object items: $ref: '#/definitions/postAnonSMSResponse' '429': description: | Too many requests. '503': description: | The service is unavailable. definitions: postAnonSMSResponse: type: object properties: data: type: object description: '' properties: reference_id: type: string description: | Unique identifier for your request/session generated by the Anonymous SMS API. A 32-digit hex value used to identify the web service request. The value is unique to each web service request, is randomly-generated by TeleSign, and is returned in the response message immediately following the web service request. session_data: type: object description: "\tAn object containing information about the phone number and the session for it (this information is returned for each phone number).\n" properties: message: type: string description: | This describes what happened during the creation of the session. For example, this value might give you a notification that the counties for phone number 1 and the assigned sender ID are different. phone_number_1: type: object description: '' properties: complete_phone_number: type: string description: | The base phone number prefixed with the country dialing code. country_code: type: string description: | A 1, 2, or 3-digit number representing the country dialing code. country_iso2: type: string description: | The ISO 3166-1 2-letter country code associated with the phone number. country_iso3: type: string description: | The ISO 3166-1 3-letter country code associated with the phone number. country_name: type: string description: | The country name associated with phone number. sender_id: type: string description: | The sender ID allocated for this phone number. resource: type: string description: | This will be sms. It is a string explaining that the anonymous session is created for SMS communication. session_end_on: type: string description: | The time stamp, in ISO 8601 format, indicating when the session will expire. validity: type: string description: | The period of time in hours indicating how long the session will be available. phone_number_2: type: object description: '' properties: complete_phone_number: type: string description: | The base phone number prefixed with the country dialing code. country_code: type: string description: | A 1, 2, or 3-digit number representing the country dialing code. country_iso2: type: string description: | The ISO 3166-1 2-letter country code associated with the phone number. country_iso3: type: string description: | The ISO 3166-1 3-letter country code associated with the phone number. country_name: type: string description: | The country name associated with phone number. sender_id: type: string description: | The sender ID allocated for this phone number. resource: type: string description: | This will be sms. It is a string explaining that the anonymous session is created for SMS communication. session_end_on: type: string description: | The time stamp, in ISO 8601 format, indicating when the session will expire. validity: type: string description: | The period of time in hours indicating how long the session will be available. status: type: object description: '' properties: code: type: string description: | A 4-digit status code telling you the outcome of the request. description: type: string description: | A text description for the specified status code. updated_on: type: string description: A timestamp in ISO 8601 format indicating when the status was last updated.